<script setup>
import { defineProps, defineEmits } from 'vue'
import u from "./u.js";
const { data } = defineProps(["data"]);
const emit = defineEmits(["menu-click"])

function menuItemClick(args) {
  emit("menu-click", args);
}


</script>
<template>
  <el-sub-menu :index="data.id">
    <template #title>
      {{ data.title }}
    </template>
    <template #default>
      <component :is="u.comps(item)" v-for="item in data.children" :data="item" @menu-click="menuItemClick" />
    </template>
  </el-sub-menu>
</template>